game = instance_find(obj_game_manager,0);
player = instance_find(obj_player_listener,0);
gui = instance_find(obj_gui_manager,0);

level = argument[1];

switch(level)
{
    case 1 :
    {
        with(game)
        {
            targetScore[0] = 20000;
            targetScore[1] = 30000;
            targetScore[2] = 40000;
        }
        
        i = 0;
        while(i < 19)
        {
            zombi = instance_create(view_xview[0] + 40 + i*15, (view_xview[0] + 30)+i*32, obj_zombi);
            with(zombi)
            {
                direction=0;
                speed=10;
            }
            
            i += 1;
        }
        
        // PLAYER //
        with(player)
        {
            maxExplosion = 3;
            nbMineinit = 2;
            nbMine = 0;
        }  
    }
    break;
    
    case 2:
    {        
        with(game)
        {
            targetScore[0] = 40000;
            targetScore[1] = 50000;
            targetScore[2] = 60000;
        }
        
        // ZOMBIES //
        i = 0;
        while(i < 18)
        {
            zombi = instance_create(view_xview[0] + 40 + i*10, (view_xview[0] + 40)+i*32, obj_zombi);
            with(zombi)
            {
                direction=0;
                speed=10;
            }
            
            i += 1;
        }
        
        i = 1;
        while(i < 25)
        {
            zombi = instance_create(view_xview[0] + 40 + i*32, (view_xview[0] + 30)+i*10, obj_zombi);
            with(zombi)
            {
                direction=270;
                speed=10;
            }
            
            i += 1;
        }
        
        // PLAYER //
        with(player)
        {
            maxExplosion = 3;
            nbMineinit = 2;
            nbMine = 0;
        }    
    }
    break;
    
    case 3:
    {
        i = 1;
        while(i < 30)
        {
            zombi = instance_create(view_xview[0] + 40 + i*32, view_hview[0] / 2, obj_zombi);
            with(zombi)
            {
                direction=0;
                speed=10;
            }
            
            i += 1;
        }
    }
    break;
    
    case 4 :
    {
        var nbZombis;
        nbZombis = random_range(15,30);
    
        with(game)
        {
            targetScore[0] = nbZombis*700
            targetScore[1] = nbZombis*900;
            targetScore[2] = nbZombis*1100;
        }
    
        i = 1;
        while(i < nbZombis)
        {
            zombi = instance_create(view_xview[0] + 40 + random_range(0,view_wview[0]-100), view_yview[0] + 40 + random_range(0,view_hview[0]-90), obj_zombi);
            with(zombi)
            {
                direction=random_range(0,359);
                speed=random_range(7,15);
            }
            
            i += 1;
        }
        
        
        // PLAYER //
        with(player)
        {
            maxExplosion = floor(random_range(1,4));
            nbMineinit = 0;
            nbMine = 0;
        }  
    }
    break;
}

// INTERFACE //
with(gui)
{
    player = instance_find(obj_player_listener,0);
}   
